package com.work.saturn.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.io.Serializable;
import java.util.List;

/**
 * @author YaoChen
 */
@SuppressWarnings("unused")
public class UserMsgDataBean implements Serializable, Parcelable {

    /**
     * name : CupidoCoin
     * symbol : CPDC
     * decimals : 8
     * amount : 1234
     * history : [{"amount":"1234","from":"f23fca33-3d97-4d2d-a803-bc37b543ad2d","timestamp":1531229252000,"to":"62bd5875-5561-41d1-ab56-e364a521d10e"}]
     */

    private String name;
    private String symbol;
    private String decimals;
    private String amount;
    private List<HistoryBean> history;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSymbol() {
        return symbol;
    }

    public void setSymbol(String symbol) {
        this.symbol = symbol;
    }

    public String getDecimals() {
        return decimals;
    }

    public void setDecimals(String decimals) {
        this.decimals = decimals;
    }

    public String getAmount() {
        return amount;
    }

    public void setAmount(String amount) {
        this.amount = amount;
    }

    public List<HistoryBean> getHistory() {
        return history;
    }

    public void setHistory(List<HistoryBean> history) {
        this.history = history;
    }

    public static class HistoryBean implements Serializable, Parcelable {
        /**
         * amount : 1234
         * from : f23fca33-3d97-4d2d-a803-bc37b543ad2d
         * timestamp : 1531229252000
         * to : 62bd5875-5561-41d1-ab56-e364a521d10e
         */

        private String amount;
        private String from;
        private long timestamp;
        private String to;

        public String getAmount() {
            return amount;
        }

        public void setAmount(String amount) {
            this.amount = amount;
        }

        public String getFrom() {
            return from;
        }

        public void setFrom(String from) {
            this.from = from;
        }

        public long getTimestamp() {
            return timestamp;
        }

        public void setTimestamp(long timestamp) {
            this.timestamp = timestamp;
        }

        public String getTo() {
            return to;
        }

        public void setTo(String to) {
            this.to = to;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.amount);
            dest.writeString(this.from);
            dest.writeLong(this.timestamp);
            dest.writeString(this.to);
        }

        public HistoryBean() {
        }

        HistoryBean(Parcel in) {
            this.amount = in.readString();
            this.from = in.readString();
            this.timestamp = in.readLong();
            this.to = in.readString();
        }

        public static final Creator<HistoryBean> CREATOR = new Creator<HistoryBean>() {
            @Override
            public HistoryBean createFromParcel(Parcel source) {
                return new HistoryBean(source);
            }

            @Override
            public HistoryBean[] newArray(int size) {
                return new HistoryBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.name);
        dest.writeString(this.symbol);
        dest.writeString(this.decimals);
        dest.writeString(this.amount);
        dest.writeTypedList(this.history);
    }

    public UserMsgDataBean() {
    }

    private UserMsgDataBean(Parcel in) {
        this.name = in.readString();
        this.symbol = in.readString();
        this.decimals = in.readString();
        this.amount = in.readString();
        this.history = in.createTypedArrayList(HistoryBean.CREATOR);
    }

    public static final Creator<UserMsgDataBean> CREATOR = new Creator<UserMsgDataBean>() {
        @Override
        public UserMsgDataBean createFromParcel(Parcel source) {
            return new UserMsgDataBean(source);
        }

        @Override
        public UserMsgDataBean[] newArray(int size) {
            return new UserMsgDataBean[size];
        }
    };
}
